#!/usr/bin/python3

import subprocess

## Functions
# Add user by name and full name
def userAdd(user, fullName, path):
    subprocess.call(['useradd', '-g', '100', '-d', path, '-c', fullName, user])

## Functions End


# Read User Information
f = open("./users.txt" , "r")
for line in f:
    records = line.split(":")
    user = records[0]
    fullName = records[1]
    fullName = fullName.rstrip()
    path = '/home/friends/' + user
    userAdd(user, fullName, path)
f.close()